﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using bdxyit.com.RecruitmentAppSys.IDAL;
using bdxyit.com.RecruitmentAppSys.DALFactory;
using bdxyit.com.RecruitmentAppSys.Models;
using bdxyit.com.RecruitmentAppSys.ViewModels;

namespace bdxyit.com.RecruitmentAppSys.BLL
{
   public class BasicInfoViewModelBLL
    {
       /// <summary>
       /// 初始化基本信息视图
       /// </summary>
       /// <returns></returns>
       public static BasicInfoViewModels InitBasicInfo(string userID)
       {
           BasicInfoViewModels basic = new BasicInfoViewModels();
           basic.UserInfo = new UserInfo();
           basic.UserInfo.UserID = userID;
           basic.EthnicList = EthnicListBLL.GetEthnicList();
           basic.Sex = SystemInfoBLL.GetSystemInfoByCode("sex");
           basic.Marital = SystemInfoBLL.GetSystemInfoByCode("MaritalStatus");
           basic.Political = SystemInfoBLL.GetSystemInfoByCode("PolAffiliation");
           basic.Vision = SystemInfoBLL.GetSystemInfoByCode("Eyesight");
           return basic;
       }

       public static BasicInfoViewModels EditBasicInfo(string userID)
       {
           BasicInfoViewModels basic = new BasicInfoViewModels();
           basic.UserInfo = UserInfoBLL.GetBasicInfoByUserID(userID);
           basic.EthnicList = EthnicListBLL.GetEthnicList();
           basic.Sex = SystemInfoBLL.GetSystemInfoByCode("sex");
           basic.Marital = SystemInfoBLL.GetSystemInfoByCode("MaritalStatus");
           basic.Political = SystemInfoBLL.GetSystemInfoByCode("PolAffiliation");
           basic.Vision = SystemInfoBLL.GetSystemInfoByCode("Eyesight");
           return basic;
       }

       public static BasicInfoViewModels DetailsBasicInfo(string userID)
       {
           BasicInfoViewModels basic = new BasicInfoViewModels();
           basic.UserInfo = UserInfoBLL.GetBasicInfoByUserID(userID);
           basic.EthnicList = EthnicListBLL.GetEthnicList();
           basic.Sex = SystemInfoBLL.GetSystemInfoByCode("sex");
           basic.Marital = SystemInfoBLL.GetSystemInfoByCode("MaritalStatus");
           basic.Political = SystemInfoBLL.GetSystemInfoByCode("PolAffiliation");
           basic.Vision = SystemInfoBLL.GetSystemInfoByCode("Eyesight");
           return basic;
       }
    }
}
